package com.muyu.product.service.impl;

import java.util.List;

import com.muyu.common.core.utils.ObjUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsCategoryAttributeMapper;
import com.muyu.product.domain.AsCategoryAttribute;
import com.muyu.product.service.AsCategoryAttributeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

/**
 * 品类属性中间Service业务层处理
 *
 * @author DongZeLiang
 * @date 2024-02-27
 */
@Slf4j
@Service
public class AsCategoryAttributeServiceImpl extends ServiceImpl<AsCategoryAttributeMapper, AsCategoryAttribute>  implements AsCategoryAttributeService {

    /**
     * 查询品类属性中间列表
     *
     * @param asCategoryAttribute 品类属性中间
     * @return 品类属性中间
     */
    @Override
    public List<AsCategoryAttribute> list(AsCategoryAttribute asCategoryAttribute) {
        LambdaQueryWrapper<AsCategoryAttribute> queryWrapper = new LambdaQueryWrapper<>();


        if (ObjUtils.notNull(asCategoryAttribute.getCategoryId())){
            queryWrapper.eq(AsCategoryAttribute::getCategoryId, asCategoryAttribute.getCategoryId());
        }

        if (ObjUtils.notNull(asCategoryAttribute.getAttributeId())){
            queryWrapper.eq(AsCategoryAttribute::getAttributeId, asCategoryAttribute.getAttributeId());
        }





        return list(queryWrapper);
    }
}
